'use strict';

angular.module('Hospital.third', ['ngRoute', 'Hospital.services'])

.config(['$routeProvider', function($routeProvider) {
	console.log($routeProvider);
	$routeProvider.when('/third', {
		templateUrl: 'views/third/third.html'
	});		
}])

//.controller('searchCtrl', ['$location', '$http', '$scope', function($location, $http, $scope) {
//	
//}])
.controller('searchCtrl', ['$location', '$http', '$scope', function($location, $http, $scope) {
	$scope.params = Object.create($scope.config.defaultPageInfo);
	$scope.getPage = function(pn) {
		if(!isNaN(pn)) {
			if($scope.params.pn === pn || pn <=0 || pn > $scope.params.pc) {
				return;
			}
			$scope.params.pn = pn;
		}
		$http.post(API_SERVER + 'projectLog/list', $scope.params).success(function(res) {
			console.log(res);
			if (res && res.code === 0) {
				$scope.params.pn =res.pageNo;
				$scope.params.pc = res.pageCnt;
				$scope.recordCnt = res.recordCnt;
				$scope.projectLogList = res.dataList;
				$scope.auditStatusMap={
						'0':'未审核',
						'1':'审核通过',
						'2':'审核拒绝'
				};
				$scope.projectTeamMap={
						'0':'前台运维组',
						'1':'业务组'
				};
			}
		});
	};
	$scope.getPage();
}]);